package de.uni.kassel.campusappver3.model;

import java.util.HashMap;

import android.graphics.Color;
import android.widget.TabHost;

import de.uni.kassel.campusappver3.R;

public class Resources {
	private static Resources instance = null;

	public static Resources getInstance(){
		if(instance == null){
			instance = new Resources();
		}
		return instance;
	}
	
	private CrawlerReturnValue mensaMeals;
	private CrawlerReturnValue events;
	private CrawlerReturnValue trainInfo;
	private TabHost tabHost;
	public HashMap<String, Branch> branches = new HashMap<String, Branch>();
	
	private Resources(){
		String contact = "University of Kassel\nDepartment of electrical engineering / computer science\n" +
						"Chair of communication technology (ComTec)\nWilhelmshoeher " +
						"Allee 73\n34121 Kassel\n";		
		//David
		branches.put("-167772163", new Branch(contact,"+49 561 804-6314",
									"david@uni-kassel.de",
									"http://www.comtec.eecs.uni-kassel.de/", 
									"Chair for Communication Technology", 
									"Prof. Dr.-Ing. Klaus David",
									R.drawable.comtec, "-167772163"));
		
		//Geihs
		contact = "Wilhelmshoeher Allee 73";
		branches.put("-167772162", new Branch(contact,"+49-(0)561-804 62 75",
				"geihs@uni-kassel.de",
				"http://www.vs.uni-kassel.de/", 
				"FG Verteilte Systeme", 
				"Prof. Dr. Kurt Geihs",
				R.drawable.verteilte_systeme, "-167772162"));
		
		//Stumme
		contact = "Wilhelmshoeher Allee 73";
		branches.put("-67500041", new Branch(contact,"+49 561 804-6251",
				"stumme@cs.uni-kassel.de",
				"http://www.kde.cs.uni-kassel.de/", 
				"Knowledge and Data Engineering", 
				"Prof. Dr. Gerd Stumme",
				R.drawable.kde, "-67500041"));
		
		//Otto
		contact = "";
		branches.put("-263683", new Branch(contact,"+49 561/804-6633",
				"",
				"http://www.theory.informatik.uni-kassel.de/", 
				"Fachgebiet Theoretische Informatik", 
				"Prof. Dr. Friedrich Otto",
				R.drawable.otto, "-263683"));
		
		branches.put("-652813", branches.get("-263683"));
		
		//Wloka
		contact = "Wilhelmshoeher Allee 71-73";
		branches.put("-652812", new Branch(contact,"+49 (0)561-804-6435 ",
				"wloka@inf.e-technik.uni-kassel.de",
				"http://cms.uni-kassel.de/unicms/index.php?id=32064", 
				"Fachgebiet Technische Informatik", 
				"Prof. Dr.-Ing. Dieter Wloka, M. Eng.",
				R.drawable.fti, "-652812"));
		
		//Alcamo CESR
		contact = "Wilhelmshoeher Allee 47";
		branches.put("5", new Branch(contact,"+495618046114",
				"alcamo@usf.uni-kassel.de",
				"http://www.usf.uni-kassel.de/cesr/", 
				"Umweltsystemtechnik", 
				"Prof. Dr.Alcamo, Joseph",
				R.drawable.cesr, "5"));
		
		//Witzigman CEP
		contact = "Wilhelmshoeher Allee 71"
				+"\nRoom: 2116";
		branches.put("-134217733", new Branch(contact,"+49 561 804-6314",
				"bernd.witzigmann@uni-kassel.de",
				"http://cms.uni-kassel.de/unicms/index.php?id=24581", 
				"Computational Electronics and Photonics", 
				"Prof. Dr. Bernd Witzigmann",
				R.drawable.cep, "-134217733"));
		
		//Zuendorf Software Engineering
		contact = "Wilhelmshoeher Allee 73";
		branches.put("-33554442", new Branch(contact,"+49-(0)561-804-6240",
				"zuendorf@uni-kassel.de",
				"http://seblog.cs.uni-kassel.de/", 
				"Software Engineering", 
				"Prof. Dr. rer. nat. Albert Zuendorf",
				R.drawable.software_engineering, "-33554442"));
		
		//Hillmer Technische Elektronik
		contact = "Heinrich-Plett-Str. 40"
				+"\n34132 Kassel ";
		branches.put("9", new Branch(contact,"+49-561-804-4885",
				"hillmer@ina.uni-kassel.de",
				"http://www.te.ina-kassel.de/index.php/home.html", 
				"Technische Elektronik", 
				"Prof. Dr. rer. nat. Hartmut Hillmer",
				R.drawable.technische_elektronik, "9"));
		
		//Schwarz Sichere Rechnertechnik
		contact = "";
		branches.put("-134217732", new Branch(contact,"",
				"",
				"http://www.rs.eecs.uni-kassel.de/", 
				"Sichere Rechnertechnik", 
				"Prof. Dr. Michael Schwarz - Juniorprofessur",
				R.drawable.rechnertechnik, "-134217732"));
		
		//Stursberg Regelungs- und Systemtheorie
		contact = "Wilhelmshoeher Allee 71 - 73";
		branches.put("-133696002", new Branch(contact,"+49 (0)561-804-6375",
				"rst@uni-kassel.de",
				"http://www.uni-kassel.de/eecs/control", 
				"Regelungs- und Systemtheorie", 
				"Prof. Dr.-Ing. Olaf Stursberg",
				R.drawable.regelungs_systemtheorie, "-133696002"));
		
		//Rechnerarchitektur und Systemprogrammierung
		contact = "Wilhelmshoeher Allee 71";
		branches.put("-66977292", new Branch(contact,"49 561 804-6586",
				"hay@uni-kassel.de",
				"http://www.rs.eecs.uni-kassel.de/", 
				"Rechnerarchitektur und Systemprogrammierung", 
				"Prof. Dr.-Ing. habil. Josef Boercsoek",
				R.drawable.rechnertechnik, "-66977292"));
		
		//Fohry Programmiersprachen
		contact = "Wilhelmshoeher Allee 71 - 73"
				+"\nRaum 2307A-2313";
		branches.put("-167769613", new Branch(contact,"+49 561 804-6270",
				"fohry@uni-kassel.de",
				"http://www.uni-kassel.de/eecs/plm", 
				"Programmiersprachen/-methodik ", 
				"Prof. Dr. rer. nat. Claudia Fohry",
				R.drawable.programmingsprachen, "-167769613"));
		
		//Praktische Informatik/Datenbanken
		contact = "Wilhelmshoeher Allee 73"
				+"\n34121 Kassel";
		branches.put("-167769612", new Branch(contact,"(0561) 8 04 - 66 21",
				"sekretariat@db.informatik.uni-kassel.de",
				"http://www.db.informatik.uni-kassel.de/", 
				"Praktische Informatik/Datenbanken", 
				"Prof. Dr. rer. pol. Lutz Wegner",
				R.drawable.praktische_informatik, "-167769612"));
		
		//Dahlhaus Nachrichtentechnik
		contact = "Dep. of Electrical Engineering / Computer Science"
			+"\nCommunications Lab"
			+"\nRoom 2315"
			+"\nWilhelmshoeher Allee 73 ";
		branches.put("-655363", new Branch(contact,"+49 (0)561 804 6556 ",
				"dahlhaus@uni-kassel.de",
				"http://www.uni-kassel.de/fb16/nt/", 
				"Nachrichtentechnik", 
				"Prof. Dr. sc. techn. Dirk Dahlhaus",
				R.drawable.nachrichtentechnik, "-655363"));
		
		//Bangert Mikrowellenelektronik
		contact = "Wilhelmshoeher Allee 73, Entrance C";
		branches.put("-33554443", new Branch(contact,"(+49)561-804-6366",
				"",
				"http://www.uni-kassel.de/fb16/hft/hf.html", 
				"Mikrowellenelektronik", 
				"Prof. Dr.-Ing. Axel Bangert",
				R.drawable.mikrowellenelektronik, "-33554443"));
		
		//Lehmann Messtechnik
		contact = "Wilhelmshoeher Allee 71, Eingang A";
		branches.put("17", new Branch(contact,"",
				"",
				"http://www.uni-kassel.de/eecs/messtechnik", 
				"Messtechnik", 
				"Prof. Dr.-Ing. habil. Peter Lehmann",
				R.drawable.messtechnik, "17"));
		
		//Sick IES
		contact = "Intelligent Embedded Systems"
					+"\nWilhelmshoeher Allee 73";
		branches.put("-167769611", new Branch(contact,"+49 (0)5 61 / 8 04-60 20",
				"bsick@uni-kassel.de",
				"http://www.ies.eecs.uni-kassel.de/", 
				"Intelligente Eingebettete Systeme", 
				"Prof. Dr. rer. nat. Bernhard Sick",
				R.drawable.intelligente_eingebettete_systeme, "-167769611"));
		contact = "";
		branches.put("-655361", branches.get("-167769611"));
		//Hiete
		contact = "Wilhelmshoeher Allee 47";
		branches.put("-133696003", new Branch(contact,"",
				"",
				"http://www.usf.uni-kassel.de/cesr/", 
				"Industrielle Oekologie und technologischer Wandel", 
				"Prof. Dr. Michael Hiete",
				R.drawable.cesr, "-133696003"));
		
		//Lange
		contact = "Fachgebiet Formale Methoden und Software-Verifikation"
				+"\nWilhelmshoeher Allee 71-73";
		branches.put("-655362", new Branch(contact,"+49 (0)561 804 -6261",
				"",
				"http://www.uni-kassel.de/eecs/fmv", 
				"Formale Methoden und Software-Verifikation", 
				"Prof. Dr. Martin Lange - Juniorprofessur",
				R.drawable.software_verifikation,"-655362"));
		
		//Brabetz
		contact = "Fachgebiet Fahrzeugsysteme und"
			+"\nGrundlagen der Elektrotechnik"
			+"\nSekretariat"
			+"\nRaum -1328"
			+"\nWilhelmshoeher Allee 73"
			+"\nD-34121 Kassel";
		branches.put("-167116810", new Branch(contact,"+49 (0) 561/804-6231",
				"sekretariat-fsg@uni-kassel.de",
				"http://www.uni-kassel.de/fb16/fsg/", 
				"Fahrzeugsysteme und Grundlagen der Elektrotechnik", 
				"Prof. Dr. rer. nat. Ludwig Brabetz",
				R.drawable.get,"-167116810"));
		
		//Braun
		contact = "Universitaet Kassel"
				+"\nFB 16 - Elektrotechnik / Informatik"
				+"\nFG Energiemanagement und Betrieb elektrischer Netze"
				+"\nWilhelmshoeher Allee 73"
				+"\n34121 Kassel ";
		branches.put("-263682", new Branch(contact,"+49 561 804-6202",
				"martin.braun@​uni-kassel.​de",
				"http://www.uni-kassel.de/eecs/e2n", 
				"Energiemanagement und Betrieb elektrischer Netze", 
				"Prof. Dr.-Ing. Martin Braun",
				R.drawable.energiemanagement,"-263682"));
		
		//Ziegler
		contact = "Universitaet Kassel"
				+"\nFachbereich Elektrotechnik/Informatik"
				+"\nFachgebiet Elektrische Maschinen und Antriebe"
				+"\nEmilienstrasse 41"
				+"\n34121 Kassel";
		branches.put("-133696000", new Branch(contact,"(0561) 804-6365",
				"http://www.uni-kassel.de/eecs/ema/",
				"http://www.evs.e-technik.uni-kassel.de/", 
				"Elektrische Maschinen und Antriebe ", 
				"Prof. Dr.-Ing. Marcus Ziegler",
				R.drawable.elektrische_maschinen,"-133696000"));
		contact = "";
		branches.put("-652810", branches.get("-133696000"));
		branches.put("-263680", branches.get("-133696000"));
		contact = "Universitaet Kassel, FB 16"
				+"\nFG Elektrische Energieversorgungssysteme"
				+"D-34121 Kassel, Wilhelmshoeher Allee 71 ";
		branches.put("25", new Branch(contact,"+49 0561804-6344",
				"evs@uni-kassel.de",
				"http://www.evs.e-technik.uni-kassel.de/", 
				"Elektrische Energieversorgungssysteme", 
				"Prof. Dr.-Ing. habil. Peter Zacharias",
				R.drawable.comtec, "25"));
		contact = "Wilhelmshoeher Allee 73, 34121 Kassel";
		branches.put("-33554441", new Branch(contact,"+49 (0) 561 804-6379",
				"mareen.biermann@uni-kassel.de",
				"http://www.uni-kassel.de/eecs/digitech", 
				"Digitaltechnik", 
				"Prof. Dr.-Ing. Peter Zipf",
				R.drawable.digitaltechnik, "-33554441"));
		contact = "";
		branches.put("27", new Branch(contact,"",
				"",
				"http://www.uni-kassel.de/eecs/fachgebiete/uc/startseite.html", 
				"Angewandte Informationssicherheit", 
				"Prof. Dr. Arno Wacker - Juniorprofessur",
				R.drawable.angewandte_informationssicherheit,"27"));
		contact = "";
		branches.put("-134217220", new Branch(contact,"",
				"",
				"http://www.uni-kassel.de/eecs/iee-aht/", 
				"Anlagen- und Hochspannungstechnik  ", 
				"Prof. Dr.-Ing. Albert Claudi",
				R.drawable.anlagen_hochspannungstechnik, "-134217220"));
		contact = "";
		branches.put("-134218240", new Branch(contact,"+49",
				"mail",
				"url", 
				"DeMoTec", 
				"prof",
				R.drawable.comtec, "-134218240"));
		contact = "";
		branches.put("-66977291", new Branch(contact,"+49",
				"mail",
				"url", 
				"Mechatronik Schwerpunkt Fahrzeug", 
				"prof",
				R.drawable.comtec, "-66977291"));		
		contact = "Oeffnungszeiten: Montag bis Donnerstag: 9 - 18 Uhr Freitag: 9 - 16 Uhr";
		branches.put("-167641601", new Branch(contact,"+49 (0) 561 - 804 6438",
				"studienservice@eecs.uni-kassel.de",
				"http://www.uni-kassel.de/eecs/fachbereich/dekanat/studienservice.html", 
				"Uni Bibliothek", 
				"Joerg AltendorfD",

				R.drawable.bibliothek, "-167641601"));
		contact = "Oeffnungszeiten: Mo, Mi, Do, Fr  09.30-12.30 Uhr Dienstags geschlossen";
		branches.put("-33686022", new Branch(contact,"0561 804-2117/2118",
				"direktion@bibliothek.uni-kassel.de ",
				"http://www.ub.uni-kassel.de/", 
				"Studienservice", 
				"Dr. Axel Halle",
				R.drawable.studienservice, "-33686022"));
	}
	
	public Branch getBranch(String branch){
		return this.branches.get(branch);		
	}

	public CrawlerReturnValue getMensaMeals() {
		return mensaMeals;
	}
	
	public CrawlerReturnValue getTrainInfo() {
		return trainInfo;
	}

	public void setMensaMeals(CrawlerReturnValue mensaMeals) {
		this.mensaMeals = mensaMeals;
	}
	
	public void setTrainInfo(CrawlerReturnValue trainInfo) {
		this.trainInfo = trainInfo;
	}
	
	public HashMap<String, Branch> getBranches(){
		return this.branches;		
	}
	
	public boolean hasBranch(String branch){
		return this.branches.containsKey(branch);
	}

	public CrawlerReturnValue getEvents() {
		return events;
	}

	public void setEvents(CrawlerReturnValue events) {
		this.events = events;
	}
	
	public void setTabHost(TabHost tabHost) {
		this.tabHost = tabHost;
	}
	
	public TabHost getTabHost() {
		return tabHost;
	}
	
	
	public static void setTabColor(TabHost tabhost) {
	    for(int i=0;i<tabhost.getTabWidget().getChildCount();i++)
	    {
	        tabhost.getTabWidget().getChildAt(i).setBackgroundColor(Color.parseColor("#FFFFFF")); //unselected
	    }
	    tabhost.getTabWidget().getChildAt(tabhost.getCurrentTab()).setBackgroundColor(Color.parseColor("#CC0066")); // selected
	}
	
}
